<template>
  <el-dialog title="操作日志信息" :visible.sync="dialog_visible" >
    <el-form
      ref="dataForm"
      :rules="rules"
      :model="temp"
      label-position="right"
      auto-complete="on"
      label-width="90px"     
      style="width: 85%; margin-left:30px"
    >
      <el-form-item label="序号" prop="id">
        <el-input disabled v-model="temp.id" />
      </el-form-item>
      <el-form-item label="操作者" prop="name">
        <el-input readonly v-model="temp.name" />
      </el-form-item>
      <el-form-item label="访问接口" prop="content">
        <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 7 }"    readonly v-model="temp.content" />
      </el-form-item>
      <el-form-item label="参数内容">
        <el-input type="textarea" :autosize="{ minRows: 3, maxRows: 7 }"    readonly v-model="temp.sql_record" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submit">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { update } from "@/api/org_device";
export default {
  name: "logShow",
  props: {
    show: {
      type: Boolean,
      default: false,
    },
    data: {
      type: Object,
      default: function () {
        return {};
      },
    },
  },
  data() {
    return {
      temp: {
        id: "",
        name: "",
        content: "",
        sql_record: "",
        create_time: "",
      },
      rules: {},
    };
  },
  computed: {
    dialog_visible: {
      get() {
        return this.show;
      },
      set(val) {
        this.$emit("update:show", val);
      },
    },
  },
  watch: {
    data: {
      handler(newValue, oldValue) {
        this.temp = Object.assign({}, this.data);
        // 当 watchedObject 或其内部属性变化时，这个函数被调用
      },
      deep: true,
    },
  },
  created() {},
  methods: {
    cancel() {
      this.dialog_visible = false;
    },
    submit() {
      this.dialog_visible = false;
    },
  },
};
</script>
